﻿.ant-table-fixed-header thead tr th.ant-dropdown-table-fixed-header-visible {
    z-index: 2;
}

.ant-dropdown-menu-position-strategy {
    width: max-content;
    top: 0;
    left: 0;
}

.ant-dropdown-menu-position-strategy-absolute {
    position: absolute;
}

.ant-dropdown-menu-position-strategy-fixed {
    position: fixed;
}

.ant-dropdown-group {
    display: inline-flex;
    white-space: nowrap;

    &.ant-dropdown-disabled.b-is-autocomplete {
        background-color: var(--b-theme-light, #f5f5f5);
    }
}

.ant-input-group-addon.ant-input-group-addon-dropdown {
    padding: 0;
    border: 0;
}

.ant-dropdown-group {
    .ant-btn.ant-dropdown-trigger:not(.ant-btn-outline) {
        color: unset;
        border-color: unset;
        border: none;
    }

    > .ant-btn:not(:last-child):not(.ant-dropdown-trigger) {
        border-top-right-radius: 0;
        border-bottom-right-radius: 0;
    }

    > .ant-btn:not(:first-child) {
        border-top-left-radius: 0;
        border-bottom-left-radius: 0;
    }
}

.ant-dropdown-group.ant-dropdown-button.b-is-autocomplete {
    width: 100%;
}

.ant-dropdown:not(.ant-dropdown-hidden) .ant-dropdown-menu {
    animation-duration: 0.3s;
    animation-fill-mode: both;
    animation-name: fadeIn;
}

.ant-dropdown-menu-header {
    display: block;
    padding: 7px 12px;
    margin-bottom: 0;
    font-size: 12px;
    color: $text-muted;
    white-space: nowrap;
}

.ant-dropdown-menu.ant-dropdown-menu-scrollable {
    max-height: var(--dropdown-list-menu-max-height, 200px);
    overflow-y: scroll;
}

.b-is-autocomplete .ant-dropdown-menu {
    max-height: var(--autocomplete-menu-max-height, 200px);
    overflow-y: scroll;

    .ant-dropdown-menu-item.focus {
        background-color: #f5f5f5;
    }
}

.b-is-autocomplete.b-is-autocomplete-multipleselection {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    max-width: 100%;
    width: 100%;
    cursor: text;
    align-items: center;
    border: 1px solid #d9d9d9;
    border-radius: .25rem;

    > input.ant-input {
        display: inline-block;
        border: none;
        box-shadow: none;
        outline: none;
        background-color: transparent;
        max-width: inherit;
        width: auto;
        flex-grow: 1;
    }

    > .ant-tag {
        margin-top: 0.25rem;
        margin-bottom: 0.25rem;
        line-height: 1.5715;
        flex-grow: initial;
    }

    &.focus {
        border-color: #40a9ff;
        border-right-width: 1px !important;
        outline: 0;
        -webkit-box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.2);
        border-color: #40a9ff;
    }
}

.ant-dropdown {
    > .ant-dropdown-menu-item {
        width: 100%;
    }

    .ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-vertical:not(.dropup, .dropright, .dropleft) {
        position: unset;

        > .ant-dropdown-menu {
            transform: translate(0, -32px);
            top: 0;
            left: 100%;
            margin-left: .1rem;
            margin-right: .1rem;
        }
    }

    .ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-vertical.dropup {
        position: unset;

        > .ant-dropdown-menu {
            top: auto;
            bottom: 100%;
            margin-top: 0;
            /*margin-bottom: $dropdown-spacer;*/
        }
    }

    .ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-vertical.dropright {
        position: unset;

        > .ant-dropdown-menu {
            top: 0;
            right: auto;
            left: 100%;
            margin-top: 0;
            /*margin-left: $dropdown-spacer;*/
        }
    }

    .ant-dropdown-menu-submenu.ant-dropdown-menu-submenu-vertical.dropleft {
        position: unset;

        > .ant-dropdown-menu {
            top: 0;
            right: 100%;
            left: auto;
            margin-top: 0;
            /*margin-right: $dropdown-spacer;*/
        }
    }
}
